package com.atguigu.dao;

import com.atguigu.base.BaseDAO;
import com.atguigu.entity.AdminRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @PACKAGE_NAME: com.atguigu.dao
 * @CLASSNAME: AdminRoleDAO
 * @AUTHOR: zhangsan
 * @DATE: 2024/4/30 18:35
 * @SINCE 17.0.7
 * @DESCRIPTION: AdminRoleDAO
 */
public interface AdminRoleDAO extends BaseDAO<AdminRole> {

    /**
     * 根据用户id查询其拥有的角色
     * @param adminId
     * @return
     */
    List<Long> findRoleIdsByAdminId(@Param("adminId") Long adminId,
                                    @Param("isDeleted") Integer isDeleted);

    AdminRole getByRoleIdAndAdminId(@Param("roleId") Long roleId,
                                    @Param("adminId") Long adminId);

    Integer updateIsDeletedById(@Param("isDeleted") Integer isDeleted,
                                @Param("id") Long id);

    Integer updateIsDeletedByRoleIdAndAdminId(AdminRole adminRole);
}
